<template>
  <div class="yh_content foSi14">
    <div style="padding-top: 20px;">
      <el-table v-loading="listLoading" :data="list" stripe style="width: 100%">
        <div slot="empty" class="m-empty-box">
          <div class="mar" style="width: 168px;height: 180px;">
            <img src="https://www.jianyigongxiang.com/public/membercard/empty.png" class="wh100">
          </div>
          <div class="title">暂无数据</div>
        </div>
        <el-table-column prop="order_id" label="订单号" />
        <el-table-column prop="message_menu_title" label="商品名称" />
        <el-table-column prop="price" label="订单金额" />
        <el-table-column prop="createtime" label="下单时间" />
        <el-table-column prop="paytime" label="支付时间" />
        <el-table-column prop="status_text" label="状态" />
      </el-table>
      <pagination
        v-show="total>0"
        :total="total"
        :page.sync="listQuery.page"
        :limit.sync="listQuery.limit"
        @pagination="getList"
      />
    </div>
  </div>
</template>

<script>
import Pagination from '@/components/Pagination' // Secondary package based on el-pagination
import {
  getXuan,
  judgeButton
} from '@/utils/limits.js'
import {
  mapGetters
} from 'vuex'
import { CreateOrder, OrderRecord } from '@/api/sms'
export default {
  name: 'SmsRecord',
  components: {
    Pagination
  },
  data() {
    return {
      list: null,
      total: 0,
      listLoading: false,
      search: {},
      listQuery: {
        page: 1,
        limit: 10
      }
    }
  },
  computed: {
    ...mapGetters([
      'permission_routes',
      'roles'
    ])
  },
  created() {
    var xuanList = [{
      name: '充值记录',
      url: '/sms/smsRecord',
      pd: true
    }]
    var xuanList1 = getXuan(xuanList, this.roles)
    this.$store.dispatch('user/changeXuan', {
      key: 'xuanList',
      value: xuanList1
    })
    this.$store.dispatch('user/changeXuan', {
      key: 'xuan',
      value: 0
    })
    this.getList()
  },
  methods: {
    suosou() {
      this.listQuery = {
        page: 1,
        limit: 10
      }
      this.getList()
    },
    getList() {
      this.listLoading = true
      var data = {
        page: this.listQuery.page,
        limit: this.listQuery.limit
      }
      OrderRecord(data).then(response => {
        const {
          data
        } = response
        this.list = data.data
        this.total = data.total
        this.listLoading = false
      }).catch(error => {
        console.log(error)
        this.listLoading = false
      })
    }
  }
}
</script>

<style lang="scss" scoped>
	.yh_content {
		padding: 20px;
	}

	.yh_topsearch {
		border: 1px solid #ccc;
		padding: 20px 20px 0px 20px;
	}

	.yh_dis {
		display: flex;
	}

	.yh_disAlc {
		align-items: center;
	}

	.topsearch_item {
		/* padding: 20px; */
	}

	.search_left {
		width: 150px;
		font-size: 12px;
		color: #838383;
	}

	.search_right {
		flex-wrap: wrap;
	}

	.sons {
		margin-left: 20px;
		cursor: pointer;
		font-size: 12px;
		margin-bottom: 15px;
	}

	.choiceme {
		color: rgb(32, 146, 48);
		font-size: 12px;
	}

	.yh_xian {
		border-bottom: 1px solid #e7e7e7;
		/* width: 98%; */
		margin: 0px auto;
		margin-bottom: 20px;
	}

	.yh_qs {
		color: #838383;
	}

	.yh_disJub {
		justify-content: space-between;
	}

	.yh_disJuc {
		justify-content: center;
	}

	.yh_font12 {
		font-size: 12px;
	}

	.yh_font13 {
		font-size: 13px;
	}

	::v-deep .el-input__inner {
		height: 32px;
		line-height: 32px;
	}
</style>
